package client;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.awt.Font;

public class DeveComWorker_2_GUI extends JDialog {

	private final JPanel contentPanel = new JPanel();

	/**
	 * Launch the application.
	 */
	/*
	 * public static void main(String[] args) { try { DeveComWorker_2_GUI dialog
	 * = new DeveComWorker_2_GUI();
	 * dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	 * dialog.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
	 * 
	 * /** Create the dialog.
	 */
	public DeveComWorker_2_GUI() {
		setTitle("\u5F00\u53D1\u90E8\u957F\u5DE5\u4F5C");
		setModalityType(ModalityType.APPLICATION_MODAL);
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		{
			JButton button = new JButton(
					"\u786E\u5B9A\u7814\u7A76\u5F00\u53D1\u9879\u76EE");
			button.setFont(new Font("宋体", Font.PLAIN, 15));
			button.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					JOptionPane.showMessageDialog(null, "你确定了一项研究项目！！");
				}

			});
			button.setBounds(145, 61, 156, 40);
			contentPanel.add(button);
		}
		{
			JButton btnNewButton = new JButton(
					"\u5E26\u9886\u56E2\u961F\u7814\u53D1\u4EA7\u54C1");
			btnNewButton.setFont(new Font("宋体", Font.PLAIN, 15));
			btnNewButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					JOptionPane.showMessageDialog(null, "你带领团队成功完成了一项项目开发！！");
					WorkEffect_GUI dialog;
					try {
						dispose();
						dialog = new WorkEffect_GUI();
						dialog.setLocationRelativeTo(null);
						dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
						dialog.setVisible(true);
					} catch (MalformedURLException e1) {
						e1.printStackTrace();
					} catch (RemoteException e1) {
						e1.printStackTrace();
					} catch (NotBoundException e1) {
						e1.printStackTrace();
					}
				}
			});
			btnNewButton.setBounds(145, 136, 156, 40);
			contentPanel.add(btnNewButton);
		}

	}

}
